package com.dudu.utils;

import com.dudu.dao.PoolNumberUtilsDao;

import core.CoreDao;

/**
 * 用于计数器使用
 * @author weidong
 *
 */
public class PoolCaseNumberTimeThread implements Runnable{

	//数据库连接dao
	CoreDao dao = null;
	PoolNumberUtilsDao poolNumberUtilsDao=null;
	String poolCaseId="";
	
	public PoolCaseNumberTimeThread(CoreDao dao, String poolCaseId, PoolNumberUtilsDao poolNumberUtilsDao){
		this.dao=dao;
		this.poolNumberUtilsDao=poolNumberUtilsDao;
		this.poolCaseId=poolCaseId;
	}
	
	@Override
	public void run() {
		//计数，将使用数量+1
		if(poolNumberUtilsDao!=null&&dao!=null){
			try {
				//操作数据库，数量+1
				poolNumberUtilsDao.updatePoolCaseNumTime(dao, poolCaseId);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

}
